﻿#region Includes
using System;
using System.Collections.Generic;
using OpenTK;
using GingerGL.Graphics;
#endregion

namespace GingerGL.Graphics.Models.MD3
{
    //------------------------------------------------------------//
    /// <summary>
    /// MD3 Mesh Structure
    /// </summary>
    public class AnimatedMesh : IDisposable
    {
        //--------------------------------------------------------//
        #region Variables
        /// <summary>
        /// Name of the Mesh
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// List of Shaders to execute
        /// </summary>
        public List<string> ShaderFiles { get; set; }
        /// <summary>
        /// Frame Data
        /// </summary>
        public List<Frame> Frames { get; set; }
        /// <summary>
        /// Mesh Indices
        /// </summary>
        public IndexBuffer Triangles { get; set; }
        #endregion
        //--------------------------------------------------------//
        #region Methods
        /// <summary>
        /// Clean up garbage
        /// </summary>
        public void Dispose()
        {
            this.Triangles.Dispose();
            this.Triangles = null;
            foreach (Frame f in this.Frames)
                f.Dispose();
            this.Frames = null;
            this.ShaderFiles.Clear();
            this.ShaderFiles = null;
            this.Name = null;
        }
        #endregion
        //--------------------------------------------------------//
    }
    //------------------------------------------------------------//
}
